//
//  UIListViewCell.m
//  List
//
//  Created by Hunk on 12-2-15.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "UIListViewCell.h"

@implementation UIListViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) 
    {
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 114.0)];
        [view setBackgroundColor:[UIColor yellowColor]];
        [self addSubview:view];
        
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 2.0, 80.0, 110.0)];
        [imageView setImage:nil];
        [imageView setTag:11];
        [view addSubview:imageView];
        [imageView release];
        
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(80.0, 2.0, 240.0, 110.0)];
        [label setText:nil];
        [label setTextAlignment:UITextAlignmentLeft];
        [label setFont:[UIFont systemFontOfSize:22.0]];
        [label setTextColor:[UIColor redColor]];
        [label setTag:12];
        [view addSubview:label];
        [label release];
        
        [view release];
        
    }
    return self;
}

- (void)setListViewCellData:(NSInteger)index
{
    UIImageView *imageView = (UIImageView *)[self viewWithTag:11];
    [imageView setImage:[UIImage imageNamed:@"product_detail_default.png"]];
    UILabel *label = (UILabel *)[self viewWithTag:12];
    [label setText:[NSString stringWithFormat:@"%d", index]];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
